function TreeListener (tree)
{
	this.updated=true;
	this.tree = tree;
}

TreeListener.prototype.onUpdate=function(dataSource, source, property, target){
}

TreeListener.prototype.update=function(dataSource, source, property, target)
{
	var tree = this.tree;
	if(tree)
	{
		tree.builder.rebuild();
	}
	this.onUpdate(dataSource, source, property, target);
}

TreeListener.prototype.onAssert = function (dataSource, source, property, target)   
{
	if (this.updated){
		this.update(dataSource, source, property, target);
	}
}

TreeListener.prototype.onBeginUpdateBatch = function (dataSource)  
{
	this.updated = false;
}

TreeListener.prototype.onChange = function ( dataSource , source, property , oldTarget, newTarget)   
{
	if (this.updated)
	{
		this.update();
	}
}

TreeListener.prototype.onEndUpdateBatch = function ( dataSource ) 
{
	this.updated=true;
	this.update(dataSource);
}

TreeListener.prototype.onMove = function ( dataSource , oldSource , newSource , property , target )
{
}

TreeListener.prototype.onUnassert = function ( dataSource, source, property, target)
{
}

